Astrocade Tape Program Archive Record
-------------------------------------

Program Name:  Memory Contents - Binary
Filename:      Memory Contents - Binary (1979)(Max Manowski)(2000 Baud)(PD).wav
Released by:   Max Manowski
Appearance:    ARCADIAN, 1, no. 6 (May 1979): 43.
Notes:         - Modifications, as listed in the original program listing,
                 are by Brett Bilbrey.
               - This program was typed into AstroBASIC on May 7, 2007
                 by Adam Trionfo.
               - The Program "Memory Contents - Binary" is exactly as it appears
                 in the Arcadian newsletter.

Description
-----------

This is a 2000 baud BASIC program for use with a Bally Astrocade and Astrobasic.

This program takes a decical number as memory location for input, then prints out the input number, followed by the contents of the memory location in AstroBASIC decical format, then the program prints out the contents of the memory location in binary format (also in AstroBASIC format).  Since AstroBASIC PEEKs at locations two bytes at a time, the binary output will be 16 bits.  Finally, the output will be in hex pair, reverse order (i.e. $FF00 = $00FF).


Instructions
------------

"Memory Dump - Binary" was written by Max Manowsky to yield binary output for a selected memory location.  Brett Bilbrey has modified it to give a full 16 bit answer, and added the comments to go with it.

Line 10 asks for the input for the desired location, the machine prints that location and then the PEEKed decimal number.
Line 20 calls for a conversion from decimal to binary, and displays binary.
Line 30-90 calls the decimal to binary conversion, performs a 'ones compliment' on the number and calls the display routine.
Line 1000 stores the binary number as a binary in @(X).
Lines 2000,2010 provide the display routine for the binary number.

What you will get looks like this arbitrary example:
   The location that I requested is 2049
                        2049          5727          .decimal
                                0001 0110 0101 1111 .binary

Additional Notes (by Adam Trionfo):
Remember that the output is in AstroBASIC format; you must reverse the hex byte pairs for the correct results!  For example if you request the first two bytes of the Astrocade ROM (3159 version), then you will get this output:

      0             (Address Requested)
  -3328             (Decimal Contents of Address Requested)
1111 0011 0000 0000 (Binary Contents of Address Requested)
  F    3    0   0   (Hex Contents of Address Requested)

The actual content of $00-$0F is:

       00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
       -----------------------------------------------
0000 - 00 F3 AF D3 08 C3 61 0C C3 07 20 1C 3C 1C 20 FF

The returned results from the program give you this

       00 01 
       -----
0000 - F3 00

As you can see, the bytes are reversed.  In this example you are reading the memory contents of 01 before the contents of 00.  When you reverse this hex pair, then you see that the results from the program are correct.

As a second example, if you request 

      2             (Address Requested)
  -11345            (Decimal Contents of Address Requested)
1101 0011 1010 1111 (Binary Contents of Address Requested)
  D    3    A    F  (Hex Contents of Address Requested)

Again, the bytes are in reverse order.  Just switch them around and you can see the second pair of hex bytes (listed in binary) of the Astrocade ROM.

Do NOT make the mistake of taking a set of eight bits and converting them to a hex number; you will get the wrong results!  Convert four bits at a time and your results will be correct.


Loading Instructions
--------------------

Plug audio cable into Astrobasic cartridge and headphone jack of computer speakers, then load program from Astrobasic with

:INPUT ;RUN

Press GO.  Then start playing the wav file; the program will start to load.  After the program finishes loading, type RUN and then press GO.

END OF FILE